xen: credit2: soft-affinity awareness in csched2_cpu_pick()
authorDario Faggioli <dario.faggioli@citrix.com>
Tue, 29 Aug 2017 09:18:51 +0000 (10:18 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Tue, 29 Aug 2017 09:18:51 +0000 (10:18 +0100)
commita5948a2b5233dc4c8771f7efb6789681ce9ce2d5
tree0ef54ee753f256fe772aaba86172f771d0bfd566
parenta64ccd3970096ffda4e27a13c29ba6b5e32e3243
xen: credit2: soft-affinity awareness in csched2_cpu_pick()

We want to find the runqueue with the least average load,
and to do that, we scan through all the runqueues.

It is, therefore, enough that, during such scan:
- we identify the runqueue with the least load, among
  the ones that have pcpus that are part of the soft
  affinity of the vcpu we're calling pick on;
- we identify the same, but for hard affinity.

At this point, we can decide whether to go for the
runqueue with the least load among the ones with some
soft-affinity, or overall.

Therefore, at the price of some code reshuffling, we
can avoid the loop.

(Also, kill a spurious ';' in the definition of MAX_LOAD.)

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Signed-off-by: Justin T. Weaver <jtweaver@hawaii.edu>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c